<template>
  <div class="divBox">
    <el-card class="box-card">
      <el-table v-loading="formLoading" :data="listData.list" style="width: 100%" size="small" highlight-current-row>
        <el-table-column label="签到得益积分" prop="oldJson.signIntegral" min-width="130"/>
        <el-table-column label="连续签到天数" prop="oldJson.continueSignDay" min-width="130"/>
        <el-table-column label="达到签到天数获得益积分" prop="oldJson.continueSignIntegral" min-width="130"/>
        <!--        <el-table-column label="注册奖励积分" min-width="130" prop="register"/>-->

        <el-table-column label="更新时间" prop="createTime" min-width="150">
        </el-table-column>
      </el-table>
      <el-pagination
          :current-page="listPram.page"
          :page-sizes="[10,20,50,80,100]"
          layout="total, sizes, prev, pager, next, jumper"
          :total="listData.count"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
      />
    </el-card>
  </div>
</template>
<script>
import {getIntegralRuleLogList} from "@/api/integral";

export default {
  components: {},
  props: {
    id: {
      default: null
    },
    type: {
      default: null
    }
  },
  data() {
    return {
      formLoading:false,
      listData: {list: [], count: 0},
      listPram: {
        page: 1,
        limit: 20,
        integralRuleId: '',
      },
    }
  },
  mounted() {
    if (this.id) {
      this.getList();
    }
  },
  methods: {
    getList() {
      this.listPram.integralRuleId=this.id;
      getIntegralRuleLogList(this.listPram).then(res => {
        this.listData = res
      }).finally(() => {
        this.formLoading = false;
      })
    },
    close() {
      this.$emit('hideRecordEditDialog')
    },
    handleSizeChange(val) {
      this.listPram.limit = val
      this.getList()
    },
    handleCurrentChange(val) {
      this.listPram.page = val
      this.getList()
    },
  }
}
</script>

<style scoped lang="scss">
::v-deep {
  .el-upload {
  }
}

.img {
  width: 80px;
  height: 80px;
  border-radius: 100px;
}
</style>
